<?php
     session_start();
	 include("../dbconnect.inc.php");
	 $form =$_POST["edit"];
	 $username = $form["name"];
	 $password = md5($form["pass"]);
	 $sql = "select * from users where username ='{$username}'and password='{$password}'";
	 $res = mysql_query($sql);
	 $row = mysql_fetch_array($res);
	 if(!$password==$row["password"]){
	        header("Location:msg.php?m=login_error");
		  exit;
     }
	 $_SESSION["userid"] = $row["id"];
	 $_SESSION["username"]=$username;
	 header("Location:../index.php");
?>